using compiler

// TODO Why not this? To avoid loading the type later? --> @compilerDsl = Mat#
// TODO I don't think the compiler should need to load this dynamically anyway.
@compilerDsl = "math::Mat"
class MatDslPlugin: DslPlugin {

	new make(Compiler c): super(c) {}

	override Expr compile(DslExpr dsl) {
		// TODO Determine matrix type here.
		type := ns.resolveType("math::ObjMat")
		method := type.method("zeros")
		// TODO method := type.method("makeWith")
		// TODO Parse exprs and ';' and whitespace including '\n' in src.
		// TODO We should need a list of some sort.
		args := [Expr.makeForLiteral(dsl.location, ns, 2)]
		return CallExpr.makeWithMethod(dsl.location, null, method, args)
	}

}
